<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>

    <h:form id="ugovorOKreditu" styleClass="edit">
    
        <rich:panel>
            <!-- <f:facet name="header">#{ugovorOKredituHome.managed ? 'Edit' : 'Add'} UgovorOKreditu</f:facet> -->
           
            <s:decorate id="ulogovaniKorisnik" template="layout/edit.xhtml">
                <ui:define name="label">ulogovani korisnik</ui:define>
					#{ulogovaniKorisnik.ime} #{ulogovaniKorisnik.prezime} 
            </s:decorate>
           
<!--  
            <s:decorate id="brojUgovoraDecoration" template="layout/edit.xhtml">
                <ui:define name="label">broj ugovora</ui:define>
                <h:inputText id="brojUgovora" 
                          value="#{ugovorOKredituHome.instance.brojUgovora}"
                           size="29">
                    <a:support event="onblur" reRender="brojUgovoraDecoration" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>
 -->       
            <div style="clear:both">
                <span class="required">*</span> 
                obavezna polja
            </div>
            
        </rich:panel>
                
        <div class="actionButtons">

            <h:commandButton id="save" 
                          value="Snimi" 
                         action="#{ugovorOKredituHome.persist}"
                       disabled="#{!ugovorOKredituHome.wired}"
                       rendered="#{!ugovorOKredituHome.managed}"/>  
                          			  
            <h:commandButton id="update" 
                          value="Izmeni" 
                         action="#{ugovorOKredituHome.update}"
                       rendered="#{ugovorOKredituHome.managed}"/>
                        			  
            <h:commandButton id="delete" 
                          value="Obrisi" 
                         action="#{ugovorOKredituHome.remove}"
                      immediate="true"
                       rendered="#{ugovorOKredituHome.managed}"/>
                    
            <s:button id="done" 
                   value="Nazad"
             propagation="end"
                    view="/UgovorOKreditu.xhtml"
                rendered="#{ugovorOKredituHome.managed}"/>
                
            <s:button id="cancel" 
                   value="Odustani"
             propagation="end"
                    view="/#{empty ugovorOKredituFrom ? 'UgovorOKredituList' : ugovorOKredituFrom}.xhtml"
                rendered="#{!ugovorOKredituHome.managed}"/>

        </div>
    </h:form>

        
        <rich:dataTable var="kreditniZahtev" 
                   value="#{ugovorOKredituHome.instance.kreditniZahtev}" 
                rendered="#{ugovorOKredituHome.instance.kreditniZahtev != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="kreditniZahtevTable">

            <h:column>
                <f:facet name="header">Broj zahteva</f:facet>
                #{kreditniZahtev.brojZahteva}
            </h:column>
            <h:column>
                <f:facet name="header">Datum zahteva</f:facet>
                #{kreditniZahtev.datumZahteva}
            </h:column>
            <h:column>
                <f:facet name="header">Iznos kredita</f:facet>
                #{kreditniZahtev.iznos} (#{kreditniZahtev.valuta.oznaka})
            </h:column>
            <h:column>
                <f:facet name="header">Iznos rate</f:facet>
                #{kreditniZahtev.iznosRate}(#{kreditniZahtev.valuta.oznaka})
            </h:column>
            <h:column>
                <f:facet name="header">Iznos ucesca</f:facet>
                #{kreditniZahtev.iznosUcesca}
            </h:column>
            <h:column>
	    	    <f:facet name="header">Namena</f:facet>
		    	#{kreditniZahtev.namena.naziv}
            </h:column>
            <h:column>
                <f:facet name="header">Rocnost kredita</f:facet>
                #{kreditniZahtev.rok} (#{kreditniZahtev.tipRocnosti.naziv})
            </h:column>
            <h:column>
	    	    <f:facet name="header">Status</f:facet>
		    	#{kreditniZahtev.status.naziv}
            </h:column>



        </rich:dataTable>

</ui:define>

</ui:composition>
